import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.2

ApplicationWindow {
    id: applicationWindow
    visible: true
    width: 640
    height: 480
    title: qsTr("Welcome")

    //        button1.onClicked: {
    //            var ret = "send";
    //            msgInfo.text = ret;
    //            msgInfo.open();
    //        }


    SwipeView {
        id: swipeView
        anchors.rightMargin: 0
        anchors.bottomMargin: 301
        anchors.fill: parent
        currentIndex: tabBar.currentIndex

        Page1Form {
        }

        Page2Form {
            width: 640
            height: 179
        }
    }

    Action{
        id:actionTB1
        text: "&New"
        shortcut:StandardKey.New
        onTriggered: {
            //area.placeholderText="To do -New"
            console.debug("To do -New");
        }

    }


    Action{
        id:actionTB2
        text: "&Open"
        shortcut:StandardKey.Open
        onTriggered: {
            //area.placeholderText="To do -Open"
            console.debug("To do -Open");
        }
    }

    header: TabBar {
        id: tabBar
        currentIndex: swipeView.currentIndex

        TabButton {
            text: qsTr("Page 1")
        }
        TabButton {
            text: qsTr("Page 2")
        }

        TabButton {
            action: actionTB1
            x: 253
            y: 6
            text: "new"
        }

        TabButton {
            action: actionTB2
            x: 490
            y: 2
            width: 131
            height: 44
            text: "Open"
        }
    }

    Page3 {
        id: page3
        x: 0
        y: 197
        width: 640
        height: 283
    }




}


